package com.dragon.upms.biz.controller;

import com.dragon.common.core.util.R;
import com.dragon.common.security.annotation.Inner;
import com.dragon.upms.api.entity.SysLog;
import com.dragon.upms.biz.service.SysLogService;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date: 2024/9/19 10:29
 * @author: ybl
 */
@RestController
@AllArgsConstructor
@RequestMapping("/log")
//@Tag(description = "log", name = "日志管理模块")
//@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class SysLogController {

    private final SysLogService sysLogService;

    /**
     * 插入日志
     * @param sysLog 日志实体
     * @return success/false
     */
    @Inner
    @PostMapping("/save")
    public R save(@Valid @RequestBody SysLog sysLog) {
        return R.success(sysLogService.saveLog(sysLog));
    }
}
